DX10 Runway/Fences/Progressive Taxi/Night textures FIX
======================================================


Steve Parsons

Email
stevefsx@yahoo.co.uk

Blog
http://stevesfsxanalysis.wordpress.com/


Discussion on AVSIM
http://forum.avsim.net/topic/376140-dx10-flashing-runways-experimental-shader/



version 2.0.1

Information
===========

These are a set of changes to one of the DX10 shaders that ships with Microsoft FSX

They address the following bugs in the DX10 preview

1) Flashing runways and Runway markings that flicker
2) White and yellow Runways markings interleaving
3) Chain fences that become opaque as the viewing angle changes
4) Progressive Taxi markings missing
5) Missing Night objects - bridges, buildings etc. From the London Eye, to Tower bridge much of the scenery disappears
at night with DX10. This patch addresses the issue.


The patch should not effect DX9 in any way.


Change History
==============
v2.0.1 Installer changes - extra checks on Shaders10 directory to better explain errors

Added notes on administator user to readme.

Removed fast search of Program Files as it can generate warnings with removable drives

v2.0 Better installer - now searches disks for FSX - if its there it should find it (I hope)

Missing night objects - major fix


Description
===========

The zip contains

this readme,

setup.bat Installation script
dowork.vbs part of installation process ( called by setup.bat)

RebuildDx10Shaders.bat - a script to delete the compiled shader folder under AppData to cause FSX to rebuild shaders
only needed if you decide to later edit PatchOptions.txt

Rebuild.vbs part of above

These three files are installed in the ShadersHLSL\General folder under the FSX installation

PatchGeneral10.txt - this contains most of the new shader logic
Patchgener10Part2.txt - this contains the latest patch to night objects
PatchOptions.txt - this allows you to disable any of the changes if it causes problems

A PDF of a blog post showing the effect of the night scenery bug over London.


Before Installation
===================

Please try and use Preview DX10 and check that it works (with the problems listed above) before applying this modification.
If you dont see the option to select DX10 then either your OS or hardware doesnt support it. Its important that you try this out first to avoid a situation where the patch gets the blame!




What the Setup.bat does
=======================

It searches for your FSX location (this may take several minutes - please let it finish!) - a faster method has been suggested to me which I will implement in the future but for now be a little patient!

It copies the three patch files into your FSX installation in the directory ShadersHLSL\General

It creates a copy of the General10.fx shader in the same folder naming it General10.fx.ORIG

It edits the General10.fx shader making two changes

Removing one line and adding one new line to include the second part of the patch

Deleting the last 7 lines and adding one new line to include the patch.

It then asks you if you would like it to delete the shaders10 directory underneath
...\AppData\Local\Microsoft\Fsx.

If you say yes this will cause FSX to recompile the shaders the next time it is run.
This is what we want so you should normally say yes!




Installation Instructions
=========================

(I am sorry but this is a very simple installer - It won't win awards for style)


1) run setup.bat

2) Confirm the location of FSX when asked

3) Agree to let it delete the Shaders10 directory

4) run FSX



SPECIAL CASE NOTE 1:

The installer will only try and remove the compiled shaders directory (Shaders10) for the user that you are currently logged in as when you run setup.

In the rare case that you run FSX using multiple username(s) then your runways will continue to flash for those other user(s).

To resolve this do the following after installation.

a) Logon to windows in turn as each user that you use to run FSX

b) run RebuildDx10Shaders.bat

c) run FSX


SPECIAL CASE NOTE 2:

Advanced users of UAC who have set their normal user to be a "standard user" and have installed REX (which runs as administrator) will actually be using a different username to run FSX.

To simplify this I have included a variant of RebuildDx10Shaders.bat that supports "run as administrator" and will remove the correct user directory for you.

After the installation is complete.

a) Right click SpecialCase2.bat and select "Run as administrator" - agree to UAC prompts

b) Run FSX


So far only one person out of 500 downloads has reported this to me as a problem, but I know that my own FSX/REX installation happens to be like this. So for me Rex runs FSX as a different (administrator enabled) user to my normal logon.


Uninstalling
===========

You would need to copy the General10.fx.ORIG to General10.fx and rebuild the shaders

I haven't included a script to do this but I may add it if asked.

You can disable any of the individual patches by editing PatchOptions.txt in \ShadersHLSL\General and using
RebuildDx10Shaders.bat - but please post a question before doing this.



Problems
========

If you have a problem installing, then please let me know even if you manage to fix it yourself.
This will allow me to improve the installer (or readme!).
I have only one pc to test on and it always works perfectly on that one ;-)


The script hunts through the whole disk looking for FSX. It should always find it although it might take a few minutes.
If it tells you that it cannot find it then you can deal with this by creating an environment variable FSXDIR with the path to the directory containing your fsx.exe file. Try my blog for some screenshots on how to do this.
However, I seriously doubt that this will occur to anyone with the latest version of the installer.


If it reports that it cannot find the Shaders10 directory to delete it includes in the message the place where it expected it to be. For almost all people it should be found in the directory

c:\users\\AppData\Local\Microsoft\FSX

If you can find the Shaders10 directory yourself then you can delete it - otherwise ask for help.


If it can find the DX9 shaders but not the DX10 it will tell you that it suspects that the DX10 shaders have already been removed. This would be the case if you ran the install twice, or had never run FSX in DX10 mode for that user.


If you normally run FSX as a different user (e.g as administrator) to the one that you are logged in as when running setup.exe then you will get a warning at this point. See Special Notes above.